package gamagora.game
{
	import Box2D.Dynamics.b2Body;
	
	import gamagora.box2d.OSPhysicBox;
	import gamagora.box2d.OSPhysicData;
	import gamagora.box2d.OSPhysicObject;
	
	import org.flixel.FlxGroup;
	import org.flixel.FlxState;
	
	public class OSWall extends OSPhysicBox
	{
		private var _angle:Number;
		
		public function OSWall(x:Number=0, y:Number=0, w:Number=0, h:Number=0, angle:Number = 0, dataType:uint = OSPhysicData.GROUND, visible:Boolean = true)
		{
			super(x, y, w, h);
			makeGraphic(w, h, dataType == OSPhysicData.BOUNCE ? 0xff00ff00: 0xff000000);
			_angle = angle;
			
			//Physique
			_physic.bodyDef.type = b2Body.b2_staticBody;
			_physic.bodyDef.angle = _angle * (Math.PI / 180);
			_physic.fixDef.friction = 0;
			_physic.fixDef.density = 0;
			_physic.fixDef.restitution = (dataType == OSPhysicData.BOUNCE) ? 1 : 0;
			
			setData(dataType);
			
			this.visible = visible;
		}
	}
}